import http from "@/utils/http.js";

export function getBannerAPI(params = {}) {
    const { distributionSite = '1' } = params//ES6 中的对象解构赋值
    return http({
        url: '/api/home/banner',
        method: 'get',
        params: {
            distributionSite
        }
    })
}

export function getNewAPI(params) {
    return http({
        url: 'http://net1.natapp1.cc/rest/product/stream',
        method: 'get',
        params
    })
}

export function getClickApi(id) {
    return http({
        url: `http://net1.natapp1.cc/rest/product/rate/${id}`,
        method: 'get',
    })
}

export function getContentbased(id) {
    return http({
        url: `http://net1.natapp1.cc/rest/product/itemcf/${id}`,
        method: 'get',
    })
}

export function getNewHotAPI(params) {
    return http({
        url: 'http://net1.natapp1.cc/rest/product/hot',
        method: 'get',
        params
    })
}

// export function getProductSearch(params) {
//     return http({
//         url: `/recom/rest/product/search`,
//         method: 'get',
//         params
//     })
// }

export function getProductSearch(data) {
    return http({
        url: `/order/api/product/getByTag`,
        method: 'POST',
        data
    })
}

export function getGoodsAPI() {
    return http({
        url: '/api/home/goods',
        method: 'get'
    })
}


